package goleetcode

func findLUSlength(strs []string) int {
	ans := -1
	loop:
	for i, s := range strs {
		for j, t := range strs {
			if i != j && isSubStr(s, t) {
				continue loop
			}
		}
		if len(s) > ans {
			ans = len(s)
		}
	}
	return ans
}

func isSubStr(str1, str2 string) bool {
	idx := 0
	for i := range str2 {
		if str1[idx] == str2[i] {
			idx++
		}
		if idx == len(str1) {
			return true
		}
	}
	return false
}